import request from '@/utils/request'
// 地块分页查询
export const getLandInfoPageApi = (params) => request.get(`/land_info/page?baseId=${params.baseId}&current=${params.current}&pageSize=${params.pageSize}&landType=${params.landType}&plantingVariety=${params.plantingVariety}&state=${params.state}&landName=${params.landName}`)
// 删除地块
export const delLandInfoApi = id => request.delete(`/land_info/removeByIds?ids=${id}`)
// 地块详情查询
export const getLandDetailApi = (params) => request.get(`/land_info/list?landId=${params.landId}&baseId=${params.baseId}`)
// 土壤检测 /sampling_report/add
export const addRepaotApi = (params) => request.post('/sampling_report/add', params)

// 获取种植历史
export function getAgriculturalList (params) {
  return request({
    url: '/agricultural_archives/page',
    method: 'get',
    params
  })
}
// 删除种植历史

export function deleteAgricultural (params) {
  return request({
    url: '/agricultural_archives/removeByIds',
    method: 'delete',
    params
  })
}

// 获取种植历史
export function getAgriculturalId (params) {
  return request({
    url: '/agricultural_archives/getAgrByLandId',
    method: 'get',
    params
  })
}

// 获取种植详情
export function getAgriculturalDetail (params) {
  return request({
    url: '/agricultural_archives/getByCondition',
    method: 'get',
    params
  })
}

// 获取报告列表
export function getPesticideList (params) {
  return request({
    url: '/pesticideResidues/getListByAgri',
    method: 'get',
    params
  })
}

// 获取农资使用列表
export function getAgriculturalApplyList (params) {
  return request({
    url: '/agricultural_apply/getListByAgriId',
    method: 'get',
    params
  })
}

// 判断是否采收
export function isAgriculturalHarvest (params) {
  return request({
    url: '/agricultural_archives/isHarvest',
    method: 'get',
    params
  })
}

export function deleteSeeding (params) {
  return request({
    url: '/seeding/removeById',
    method: 'delete',
    params
  })
}

export function getSeedDetail (params) {
  return request({
    url: '/seeding/getByCondition',
    method: 'get',
    params
  })
}

// 修改农事播种信息
export function updateBySeed (data) {
  return request({
    url: '/seeding/updateBySeed',
    method: 'patch',
    data
  })
}
